<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	template="../templates/user_template.xhtml">

	<ui:define name="css-styles">
		<h:outputStylesheet library="css" name="login-style.css" />
	</ui:define>

	<ui:define name="title">
		Смяна на парола
	</ui:define>

	<ui:define name="content">

		<div id="wraper">
			<div id="header">
				<h1>
					<h:outputText value="Change Password" />
				</h1>
			</div>
			<div id="changepass">
				<h:form id="changepass-form">
					<h:outputText value="#{chagePassword.message}" styleClass="success" />
					<h:outputText value="#{chagePassword.warning}" styleClass="warning" />
					<table>
						<tr>
							<td>
								<h:outputText value="Old Password:" />
							</td>
							<td>
								<h:inputSecret id="oldPassword"
									value="#{chagePassword.oldPassword}"
									requiredMessage="*Field is required"
									validator="#{chagePassword.oldPasswordValidator}"
									required="true">
									<f:validateLength minimum="5" maximum="20" />
								</h:inputSecret>
							</td>
							<td>
								<h:message for="oldPassword" styleClass="warning" />
							</td>
						</tr>
						<tr>
							<td>
								<h:outputText value="New Password:" />
							</td>
							<td>
								<h:inputSecret id="newPassword"
									value="#{chagePassword.newPassword}"
									requiredMessage="*Field is required"
									validatorMessage="*Length is less than allowable minimum of '5'"
									required="true">
									<f:validateLength minimum="5" maximum="15" />
								</h:inputSecret>
							</td>
							<td>
								<h:message for="newPassword" styleClass="warning" />
							</td>
						</tr>
						<tr>
							<td>
								<h:outputText value="Repeat Password:" />
							</td>
							<td>
								<h:inputSecret id="repeatPassword"
									value="#{chagePassword.repeatPassword}" required="true"
									validator="#{chagePassword.passwordValidator}"
									requiredMessage="*Field is required" />
							</td>
							<td>
								<h:message for="repeatPassword" styleClass="warning" />
							</td>
						</tr>
					</table>
					<h:commandButton value="Change Password"
						action="#{chagePassword.changePassword}" styleClass="buttonChangePass"/>
				</h:form>
			</div>
			<div id="footer"></div>
		</div>

	</ui:define>
</ui:composition>